import Vue from '../../node_modules/vue'

import VueRouter from '../../node_modules/vue-router'
const Home = ()=>import('../views/home/Home')
const Category = ()=>import('../views/category/Category')
const Cart = ()=>import('../views/cart/Cart')
const Profile = ()=>import('../views/profile/Profile')



Vue.use(VueRouter)

const routes = [
    {
        path:'',
        redirect: '/home'
    },
    {
        path:'/home',
        component: Home
    },
    {
        path:'/cart',
        component: Cart
    },
    {
        path:'/profile',
        component: Profile
    },
    {
        path:'/category',
        component:Category
    }

]

const vuerouter = new VueRouter({
        routes,
        //路径会有#   ，因为默认使用的时url的hash模式改成histroy就好
        mode:'history'
        
})


export default vuerouter